<script setup>
  import useFileList from '@/components/filedrop/file-list'
  import DropFileZone from '@/components/filedrop/DropFileZone.vue'

  const props = defineProps({
    waiting: { type: Boolean, default: false },
  })
  const emit = defineEmits(['upload'])
  const { files, addFiles } = useFileList()

  const onFileDropped = (fileData) => {
    addFiles(fileData)
    emit('upload', files.value)
  }
</script>
<template>
  <DropFileZone @files-dropped="onFileDropped">
    <div class="alert alert-info" v-if="waiting">
      Transmission des fichiers en cours...
    </div>
  </DropFileZone>
</template>
